﻿#region Imports...
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Arch;
using InvoiceChecking.Data;
using InvoiceChecking.Data.SqlClient;
using InvoiceChecking.Web.UI;
#endregion

public partial class CreditCardEdit : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{		
		FormUtil.RedirectAfterInsertUpdate(FormView1, "CreditCardEdit.aspx?{0}", CreditCardDataSource);
		FormUtil.RedirectAfterAddNew(FormView1, "CreditCardEdit.aspx");
		FormUtil.RedirectAfterCancel(FormView1, "CreditCard.aspx");
		FormUtil.SetDefaultMode(FormView1, "CreditCardId");
	}

    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);
        HttpCookie httpCookie = Request.Cookies["ICConnectionString"];
        if (httpCookie != null)
        {
            SqlNetTiersProvider provider = GlobalUtilities.CreateSunProvider(Server.MapPath("~") + "/Config.xml",
                                                                          httpCookie.Value);
            if (provider != null)
                DataRepository.LoadProvider(provider, true);
        }
    }

}


